package com.atguigu.edu.controller;

import com.atguigu.response.RetVal;
import org.springframework.web.bind.annotation.*;

/**
 * @author ：HB
 * @date ：Created in 2020/11/2 20:03
 * @description：登录的controller
 *
 * @CrossOrigin:用于解决前端的跨域问题【CROS】
 */
@RestController
@RequestMapping("/edu")
@CrossOrigin
public class EntranceController {

    @PostMapping("/user/login")
    public RetVal login(){
        return RetVal.success().data("token","admin");
    }
    @GetMapping("/user/info")
    public RetVal info(){
        return RetVal.success().data("roles","[admin]").data("name","admin").data( "avatar", "https://wpimg.wallstcn.com/f778738c-e4f8-4870-b634-56703b4acafe.gif");
    }
}
